#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int fun(int n, int r);

int main()

{

    int result = 0, n = 8, r = 2;

    result = fun(n, r);

    printf("fun(%d,%d)=%d\n", n, r, result);

}

int fun(int n, int r)

{

    if (r > n)

        return 0;

    if (r == 0 || n == 0 || n == 1)

        return 1;

    return

        fun(n - 1, r) + fun(n - 1, r - 1);

}